From 0a0bb99cf493f419071764fca604ce8bedd53205 Mon Sep 17 00:00:00 2001 From: "mjw@wray-m-3.hpl.hp.com" Date: Thu, 12 Aug 2004 09:18:19 +0000 Subject: [PATCH] bitkeeper revision 1.1159.1.40 (411b35dbH9xNYJhiWeq5taj0xdMP2w) Stop libcurl using http_proxy. --- tools/python/xen/xend/XendMigrate.py | 6 ++++-- tools/xfrd/xen_domain.c | 10 ++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/tools/python/xen/xend/XendMigrate.py b/tools/python/xen/xend/XendMigrate.py index 5b10f4c358..cc248d427b 100644 --- a/tools/python/xen/xend/XendMigrate.py +++ b/tools/python/xen/xend/XendMigrate.py @@ -389,8 +389,8 @@ class XendMigrate: def session_begin(self, info): self._add_session(info.xid, info) - mcf = XfrdClientFactory(info) - reactor.connectTCP('localhost', XFRD_PORT, mcf) + xcf = XfrdClientFactory(info) + reactor.connectTCP('localhost', XFRD_PORT, xcf) return info def migrate_begin(self, dom, host, port=XFRD_PORT): @@ -401,6 +401,8 @@ class XendMigrate: @param port: destination port @return: deferred """ + if host in ['localhost', '127.0.0.1']: + raise XendError('cannot migrate to localhost') # Check dom for existence, not migrating already. # Subscribe to migrate notifications (for updating). xid = self.nextid() diff --git a/tools/xfrd/xen_domain.c b/tools/xfrd/xen_domain.c index 7125893998..27135b95ef 100644 --- a/tools/xfrd/xen_domain.c +++ b/tools/xfrd/xen_domain.c @@ -142,11 +142,19 @@ static int do_curl_global_init = 1; static CURL *curlinit(void){ if(do_curl_global_init){ do_curl_global_init = 0; + // Stop libcurl using the proxy. There's a curl option to + // set the proxy - but no option to defeat it. + unsetenv("http_proxy"); curl_global_init(CURL_GLOBAL_ALL); } return curl_easy_init(); } +int curldebug(CURL *curl, curl_infotype ty, char *buf, size_t buf_n, void *data){ + printf("%*s\n", buf_n, buf); + return 0; +} + /** Configure a new domain. Talk to xend using libcurl. */ int xen_domain_configure(uint32_t dom, char *vmconfig, int vmconfig_n){ @@ -195,6 +203,8 @@ int xen_domain_configure(uint32_t dom, char *vmconfig, int vmconfig_n){ eprintf("> Error adding op field.\n"); goto exit; } + curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); + curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, curldebug); // No progress meter. //curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1); // Completely quiet. -- 2.30.2